// 小于0。5 补到0.5 大于0.5就加1
let addor = (val) =>{
    val = val.toFixed(1)
    let mom = val.substr(0, val.length-1)
    let n = val.charAt(val.length-1)
    return n<=5 ? Number(mom+'5'):Number(mom)+1
}
// y轴刻度尺计算
let getYvalue = (val) => {
    if(val < 0.01){
        return val
    }else if(val < 1){
        return Math.round(val*10+0.5)/10
    }else if(val < 10){
        let v = Math.round(val)
        return v>5 ? 10 : v+1
    }else if(val < 100){
        return addor(val/10)*10
    }else{
        return addor(val/100)*100
    }
}
export {getYvalue}